import { PetExploreAreaInfo } from "./info/PetExploreAreaInfo";
import { ConfigManager } from "../../../com/gengine/resource/ConfigManager";
type int = number;
//class PetExploreAreaConfig
    
    export  class PetExploreAreaConfig
    {
        constructor()
        {
            
            this._map = new Map<any, any> /* flash.utils.Dictionary */();
            if (PetExploreAreaConfig._instance != null) 
            {
                throw new Error(" PetExploreAreaConfig 单例 ");
            }
            this.init();
            return;
        }

        /* internal  */write(arg1: Object): void
        {
            var loc1=null;
            var loc2=null;
            var loc3=0;
            var loc4=arg1;
            for(loc2 of loc4) 
            {
                loc1 = new PetExploreAreaInfo();
                loc1.id = loc2.id;
                loc1.area = loc2.area;
                loc1.name = loc2.name;
                loc1.drawCost = loc2.drawCost;
                loc1.drawUnit = loc2.drawUnit;
                loc1.openCost = loc2.openCost;
                loc1.parse();
                this._map[loc1.area] = loc1;
            }
            return;
        }

        public init(): void
        {
            var loc1=ConfigManager.instance.getJSONByFileName("t_pet_explore_area_config.json");
            this.write(loc1);
            return;
        }

        public getAreaConfigByArea(arg1: int): PetExploreAreaInfo
        {
            return this._map[arg1];
        }

        public static get instance(): PetExploreAreaConfig
        {
            if (PetExploreAreaConfig._instance == null) 
            {
                PetExploreAreaConfig._instance = new PetExploreAreaConfig();
            }
            return PetExploreAreaConfig._instance;
        }

        /* internal */ /* var */_map: Map<any, any> /* flash.utils.Dictionary */;

        /* internal */ static /* var */_instance: PetExploreAreaConfig;
    }
